package net.lab0.tools.evo.test.stubs;

import java.util.ArrayList;
import java.util.List;

import net.lab0.tools.evo.iface.Individual;

/**
 * 
 * @author 116@lab0.net
 * 
 *         A stub class implementing the {@link Individual} interface without doing anything. For test purposes.
 * 
 */
public class DummyIndividual
implements Individual<DummyIndividual>
{
    public double fitness;
    
    public DummyIndividual(double fitness)
    {
        super();
        this.fitness = fitness;
    }
    
    @Override
    public void mutate()
    {
        System.out.println("mutation");
    }
    
    @Override
    public List<DummyIndividual> cross(DummyIndividual other)
    {
        System.out.println("cross");
        List<DummyIndividual> list = new ArrayList<>(2);
        list.add(this);
        list.add(other);
        return list;
    }
    
    @Override
    public double getFitness()
    {
        return fitness;
    }
    
}
